<?php

namespace IDock\Insurance\HBIC\Request;

use IDock\Insurance\DAJIA\Response\InsuranceOrderQueryResponse;
use IDock\Insurance\HBIC\Bean\BASEPART;
use IDock\Insurance\HBIC\Bean\CAR;
use IDock\Insurance\HBIC\Bean\CARSHIPTAX;
use IDock\Insurance\HBIC\Bean\CHANGEBASEPART;
use IDock\Insurance\HBIC\Bean\DEVICE;
use IDock\Insurance\HBIC\Bean\KIND;
use IDock\Insurance\HBIC\Bean\NOCAR;
use IDock\Insurance\HBIC\Bean\PERSONNEL;
use IDock\Insurance\HBIC\Response\CommonResponse;
use IDock\Visitor\VehicleModelVisitor;

class CarModelQueryRequest extends AllHBICRequest
{
    protected $requestType = 'A03';

    protected $userCode = '3600002018';
    protected $userPassword = '111';

    protected $comCode = '0101';

    protected $methodName = 'queryVehicleTypeForWZ';

    protected $resourceType = 'FORCE';

    protected $response = CommonResponse::class;

    protected $urlTip = '精准车型查询';

    /**
     * @var VehicleModelVisitor $visitor
     */
    protected $visitor;

    public function generate(): array
    {
        $param = [
            'HEAD' => [
                'REQUEST_TYPE' => $this->requestType,
                'USERCODE' => $this->userCode,
                'USERPASSWORD' => $this->userPassword,
                'COMCODE' => $this->comCode,
                'MESSAGEID' => $this->requestType.substr($this->userCode,0,4).date('YmdHis').rand(10000000000,99999999999),
            ],
            'BODY' => [
                'methodName' => $this->methodName,
                'resourceType' => $this->resourceType,
                'CAR' => [
                    'ENGINENUMBER' => $this->visitor->engineNo,
                    'VINCODE' => $this->visitor->vin,//vin
                    'FIRSTREGISTERDATE' => $this->visitor->firstRegisterDate,//初登日期
                    'LICENSENO' => $this->visitor->licenseNo,//车牌号
                ],
                'SYSCODEINFO' => [
                    'INPUTSYSCODE' => 'A1'
                ],
                'SIGNINFO' => [
                    'SIGN' => '9748DBBCC0DD6BAB131B85D65D94D0D4'
                ],
            ]
        ];
        return $param;
    }


}